package com.iotechn.unimall.admin.api.company;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.CompanyDO;

import java.util.List;

@HttpOpenApi(group = "admin.company", description = "商户管理")
public interface AdminCompanyService {

    @HttpMethod(description = "列表", permission = "sys:company:list", permissionParentName = "商户管理", permissionName = "商户管理")
    public Page<CompanyDO> list(
            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "搜索名称") String name,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "下拉列表", permission = "sys:company:xialist", permissionParentName = "商户管理", permissionName = "商户管理")
    public List<CompanyDO> xialist(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "添加", permission = "sys:company:create", permissionParentName = "商户管理", permissionName = "商户管理")
    public String create(
            @NotNull @HttpParam(name = "companyName", type = HttpParamType.COMMON, description = "商户名称") String companyName,
            @NotNull @HttpParam(name = "companyAddress", type = HttpParamType.COMMON, description = "商户地址") String companyAddress,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "删除", permission = "sys:company:delete", permissionParentName = "商户管理", permissionName = "商户管理")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "商户Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "更新", permission = "sys:company:update", permissionParentName = "商户管理", permissionName = "商户管理")
    public String update(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "商户ID") Long id,
            @NotNull @HttpParam(name = "companyName", type = HttpParamType.COMMON, description = "商户名称") String companyName,
            @NotNull @HttpParam(name = "companyAddress", type = HttpParamType.COMMON, description = "商户地址") String companyAddress,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
}
